package com.dong.juc;

import java.util.concurrent.locks.LockSupport;

/**
 * description
 *
 * @author Administrator 2021/08/25 16:56
 */
public class LockSupportInterrupt {

    public static void main(String[] args) {
        Thread thread = new InterruptThread();

        thread.start();
        try {
            Thread.sleep(500L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        thread.interrupt();
        System.out.println("thread is interrupted");
    }

    static class InterruptThread extends Thread{

        @Override
        public void run() {
            System.out.println("before park");
            LockSupport.park();
            System.out.println("after park");
        }
    }

}
